<?php
include('../config.php');

// 查询shop表里的所有数据
$sql = "select * from shop";

$res = mysql_query($sql);

$list = array();
// 从$res资源类型数据里一行一行的取数据，把每一行数据都push到list里
while ($row = mysql_fetch_assoc($res)) {
  array_push($list, $row);
}
// 按照接口文档构造要给前端返回的数据格式
$json = array(
  "code" => 200,
  "body" => array(
    "list" => $list
  )
);

echo json_encode($json);

?>